<%@ page contentType="text/html; charset=utf-8" language="java" %>
<%@ include file="/sys/include/header.jsp" %>
<%@ page import="java.util.*, com.es.common.*"%>
 

<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
	<link href="sys/style01/css/table.css" rel="stylesheet" type="text/css" />
	<link href="sys/css/banzu.css" rel="stylesheet" type="text/css"  >

<%   
  //设置缓存为空   
  response.setHeader("Pragma","No-cache");   
  response.setHeader("Cache-Control","no-cache");   
  response.setDateHeader("Expires",   0); 
 
	CommonTypeBean cmnType = new CommonTypeBean();
	HashMap<String, String> typeMap = cmnType.getCommonType();
	String type;
	String key = "";
	String item_id="";
	if(request.getParameter("changeitem_id")!=null)
		  item_id=request.getParameter("changeitem_id").trim();
	if(request.getAttribute("changeitem_id")!=null)
		item_id=request.getAttribute("changeitem_id").toString().trim();
  %>
<script type="text/javascript">

//获取类型
function selectitem(el)
{
	document.changeform.changeitem_id.value=el;
	document.changeform.submit();
}

function dodelete()
{
	if (confirm("是否确认删除？删除后数据不可见！")) 
	{
	  return true;
	 } 
	 else 
	 { 
	  return false;
	 }

}

</script>

 </HEAD>

 <BODY class="ridgeBody">

<form name="form1" method="post" action="">
<input name="item_id" type="hidden" value="<%=item_id %>" class="input" /> 

  <table align="left" class=datatable width=50% cellpadding='0' cellspacing='0' border='1' bordercolorDark='white' bordercolorLight='#BEBEBE' >
      <!--DWLayoutTable-->
      <tr >
        <TD height="28" colspan="2" valign="top" class="dataTitle">查询Common</TD>
    </tr>

      <tr>
        <TD width=30% height="22" valign="top" nowrap class="datatr1">选择类型<font color="#FF0000">*</font>：</TD>
	
	    <TD width="184" valign="top" nowrap >
	
        <select name="item_name" class="input" onChange="selectitem(this.options[selectedIndex].value)">
          <option value="" selected>选择项目</option> 
          <%
			  	for(Iterator it = typeMap.keySet().iterator();it.hasNext();)
			  	{
			  		key =  it.next().toString();
			  		type = typeMap.get(key);
			  		if(key.equals(item_id))
			  		{
			  %>
			   
          			<option value="<%=key%>" selected><%=type%></option> 
          
            <%
			  	}else{	  
			  %>  
			  		 <option value="<%=key%>"><%=type%></option> 
         <%}} %>	
			  		
          </select> 
         
           
       	</TD>
 	</tr>
 	
 	
  </table>
<br><br><br>
 	 
  	<table width="100%" align="left" cellpadding='0' cellspacing='0' border='1' bordercolorDark='white' bordercolorLight='#BEBEBE' class="datatable">

<tr>
<td class="dataTitle" align="center">&nbsp;序号&nbsp;</td>
<td class="dataTitle" align="center">&nbsp;编码&nbsp;</td>
<td class="dataTitle" align="center">&nbsp;名称&nbsp;</td>
<td class="dataTitle" align="center">&nbsp;操作&nbsp;</td>
</tr>

<%
ArrayList<CommonBean> commonBeans = new ArrayList<CommonBean>();
if(session.getAttribute("list")!=null)
{
	commonBeans	=( ArrayList<CommonBean>)session.getAttribute("list");
	session.removeAttribute("list");
}
int i;
CommonBean cmnBean;
for(i = 0; i < commonBeans.size(); ++i){
	cmnBean = (CommonBean)commonBeans.get(i);
	
%>
	
<tr class="datatr" align="center" onMouseOver=this.className='udatatr' onMouseOut=this.className='datatr'>
<td class="Table_str" nowrap="nowrap"><%=i%>&nbsp;</td>
<td class="Table_str" nowrap="nowrap"><%=cmnBean.getCommonCode() %>&nbsp;</td>
<td class="Table_str" nowrap="nowrap"><%=cmnBean.getCommonValue()%>&nbsp;</td>
<td class="Table_tool"><a href="jsp/common/commonmodify.jsp?common_id=<%=cmnBean.getCommonId()%>&changeitem_id=<%=item_id %>" ><IMG border=0 SRC='sys/images/edit.gif' alt='编辑'></a> <a href="jsp/common/commondelete.action?common_id=<%=cmnBean.getCommonId()%>&changeitem_id=<%=item_id %>" onClick="return dodelete()"><IMG border=0 SRC='sys/images/del.gif' alt='删除'></a></td>

</tr>
<% }%>
 	</table>
</br></br></br>
</form>
<form name="changeform" method="post" action="jsp/common/commonsearch.action">
	 <input name="changeitem_id" type="hidden" value="<%=item_id %>" class="input" /> 
	 </form>
 </BODY>
</HTML>